#ifndef TEST_INCLUED
#define TEST_INCLUED

#include <SFML/Graphics.hpp>

#include "GuiListener.hpp"
#include "Widget.hpp"

class Test : public gui::Widget
{
    public:
        Test() :
            Widget(NULL)
        {
            myColor = sf::Color(255,255,255);
        }

    protected:
        virtual void Render(sf::RenderTarget& target, sf::Renderer &renderer) const
        {
            renderer.SetColor(myColor);
            renderer.Begin(sf::Renderer::QuadList);
                renderer.AddVertex(myRect.Left, myRect.Top);
                renderer.AddVertex(myRect.Right, myRect.Top);
                renderer.AddVertex(myRect.Right, myRect.Bottom);
                renderer.AddVertex(myRect.Left, myRect.Bottom);
            renderer.End();

        }

        virtual void OnMouseClicked(sf::Event& event)
        {
            if(event.MouseButton.Button == sf::Mouse::Left)
            {
                sf::Event temp;
                    temp.Type = sf::Event::Closed;
                gui::GuiListener::GetSingleton()->AddEvent(temp);
            }
        }

        virtual void OnMouseEntered(sf::Event& event)
        {
            myColor = sf::Color(125,125,125);
        }

        virtual void OnMouseLeft(sf::Event& event)
        {
            myColor = sf::Color(255,255,255);
        }

        protected:
        sf::Color myColor;



};
#endif


